<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1, maximum-scale=1,minimum-scale=1, user-scalable=no"
    />
    <title>外部的js文件</title>
    <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
  </head>
  <body>
    <!-- 点击设置box的font-size -->
    <div class="box" onclick="javascript:this.style.fontSize='32px'"></div>
    <!-- 阻止a的默认跳转事件 -->
    <a href="javascript:void(0)">hello</a>
    <!-- 阻止了表单的默认事件 -->
    <form action="javascript:void(0)" method="get" enctype="application/x-www-form-urlencoded">
      <!-- <form action="https://www.baidu.com" method="post"> -->
      <input type="text" placeholder="keys" name="username" />
      <input type="submit" class="submit" />
    </form>
    <!-- 此时script中不能写代码，写了也无效，不是使用自闭合标签 -->
    <script src="./js/demo2.js"></script>
  </body>
</html>
